package com.yvon.maple.service.msg.core.model.entity;

import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yvon.boot.mybatis.model.BaseEntity;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author : Yvon
 * @since : 2021-08-26
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("msg_im_consumer")
public class ImConsumer implements Serializable {

    /**
     * id.
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 消息编号
     */
    private Long messageId;

    /**
     * 账号
     */
    private Long userId;

    /**
     * 是否阅读
     */
    @TableField(value = "`read`")
    private Boolean read;

    /**
     * 阅读时间
     */
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime readTime;
}
